class Feed::EnterCreated < Feed
  validates :enter_id,
    :order_made_id,
    :presence => true

  before_validation do |feed|
    feed.order_item = enter.order_item
  end

  def code
    ActiveSupport::StringInquirer.new('has_been_entered')
  end

  def short_desc
    "于#{enter.entered_on}到货,包装号为#{enter.package_codes}，并<b>存放</b>在【#{enter.factory_name}-#{enter.warehouse_name}】，共计【#{enter.entered_count}件】"
  end

  def remark
    enter.remark
  end

  def related_one
    enter
  end
  
  def related_html_id
    "related_order_made_#{order_made_id}"
  end
  
  def related_type
    "related_order_made"
  end
end
